package com.tang.design.strategy;

/**
 * @author tmh
 * @date 2024/6/3 21:44
 * @description
 */
public class StrategyApplication {
    public static void main(String[] args) {
        int num1=3;
        int num2=7;
        //使用加法策略
        Context context=new Context(new AddStrategy());
        System.out.println(context.executeStrategy(num1, num2));
        //使用乘法策略
        context=new Context(new MultipartStrategy());
        System.out.println(context.executeStrategy(num1, num2));
    }
}
